export default {
    data() {
      return {
        navbarHeight: 0,
        statusBarHeight: 0,
        titleBarHeight: 0
      }
    },
    created() {
      this.initNavbarInfo()
    },
    methods: {
      initNavbarInfo() {
        const systemInfo = uni.getSystemInfoSync()
        this.statusBarHeight = systemInfo.statusBarHeight || 20
        
        // #ifdef MP-WEIXIN
        const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
        this.titleBarHeight = (menuButtonInfo.top - systemInfo.statusBarHeight) * 2 + menuButtonInfo.height
        // #endif
        
        // #ifndef MP-WEIXIN
        this.titleBarHeight = 44
        // #endif
        
        this.navbarHeight = this.statusBarHeight + this.titleBarHeight
      }
    }
  }